#pragma once
#include "ProSection.h"
#include <memory>
#include "wCollection.hpp"
#include <vector>
#include "wProContour.hpp"
#include "wProException.hpp"
#include "wProSecerror.hpp"

namespace witotk{



	class wProSection:public wOHandle<ProSection>
	{
	public:

		wProSection(ProSection suf):wOHandle<ProSection>(suf)
		{

		}

		void EntityUseOffsetChain( 
			ProSelection ref_sel1  
			,ProSelection ref_sel2  
			,ProSelection ref_vertex  
			,double offset_val  )
		{
			
			/* (Out) Offset dimension ID. May be NULL. */ 
			int dim_id;  
			/* (Out) The array of identifiers of entities added. The function allocates the memory for this argument. Call the function ProArrayFree() to release the memory. May be NULL. */ 
			int* p_id_list;  
			/* (Out) The size of the p_id_list array. May be NULL. */ 
			int p_num_ids;  

			ProError error= ProSectionEntityUseOffsetChain
				(m_data,
				ref_sel1,
				ref_sel2,
				ref_vertex,
				offset_val,
				&dim_id,
				&p_id_list,
				&p_num_ids
				);
			PROE_THROW(error,"EntityUseOffsetChain");
		}

		void EntityUseCurveChain(ProSelection ref_sel1  
			,ProSelection ref_sel2  
			,ProSelection ref_vertex  
			 )
		{
	 
			/* (Out) The array of identifiers of entities added. The function allocates the memory for this argument. Call the function ProArrayFree() to release the memory. May be NULL. */ 
			int* p_id_list;  
			/* (Out) The size of the p_id_list array. May be NULL. */ 
			int p_num_ids;  

			ProError error= ProSectionEntityUseCurveChain
				(m_data,
				ref_sel1,
				ref_sel2,
				ref_vertex,
				&p_id_list,
				&p_num_ids
				);
			PROE_THROW(error,"EntityUseCurveChain");
		}

		void EntityUseEdge(ProSelection ref_sel1)
		{
			int ids;  

			ProError error= ProSectionEntityUseEdge(m_data,ref_sel1,&ids);
				
			PROE_THROW(error,"EntityUseEdge");
		}

		void EntityFromProjection(ProSelection ref_sel1)
		{
			int ids;  

			ProError error= ProSectionEntityFromProjection(m_data,ref_sel1,&ids);

			PROE_THROW(error,"EntityFromProjection");
		}

		void Autodim(ProWSecerror* sec_errors)
		{
			ProError error = ProSectionAutodim(m_data, sec_errors);
			PROE_THROW(error,"Autodim");
		}

		void Regenerate(ProWSecerror* sec_errors)
		{
			ProError error = ProSectionRegenerate(m_data, sec_errors);
			PROE_THROW(error,"Regenerate");
		}

		void Solve(ProWSecerror* sec_errors)
		{
			ProError error = ProSectionSolve(m_data, sec_errors);
			PROE_THROW(error,"Solve");
		}

		//GetEntitys();
		//ProSectionEntityIdsGet();

	};

	typedef	std::tr1::shared_ptr<wProSection> wProSection_ptr;


}